/*
 * Propeller.h
 *
 *  Created on: Apr 12, 2010
 *      Author: andrew
 */

#ifndef PROPELLER_H_
#define PROPELLER_H_

class Propeller {
	int Nblades;
	double actualRadius, hubR, rootC, tipC, rootI, tipI, cd0, cd1, cd2, cl0, clmax;
	double J,eta,CT,CQ,CP;

	static const int Nstations=20;
	static const int maxit=10;

public:

	/**
	 * Constructor with inputs:
	 * Nblades - number of blades
	 * hub_radius - Hub radius / radius
	 * root and tip chord also normalized by radius
	 * root/tip incidence in degrees
	 * cd0,cd1,cd2 - quadratic fit to drag polar
	 * cl0 - cl at alpha = 0
	 * clmax
	 */
	Propeller(int Nblades, double radius, double hub_radius, double root_chord, double tip_chord,
			double root_inc, double tip_inc, double cd0, double cd1, double cd2, double cl0, double clmax);

	/**
	 * get radius of propeller
	 */
	double getRadius();

	/**
	 * set the advance ratio for the propeller
	 */
	void setAdvanceRatio(double J);

	/**
	 * get propeller efficiency
	 */
	double getEfficiency(double J);

	/**
	 * CT - thrust coefficient (T/(rho n^2 D^4)) (n - rev/sec, D-diameter)
	 */
	double getThrustCoefficient(double J);

	/**
	 * CQ - torque coefficient (torque/(rho n^2 D^5))
	 */
	double getTorqueCoefficient(double J);

	/**
	 * CP - power coefficient (Power_in / (rho n^3 D^5))
	 */
	double getPowerCoefficient(double J);
};

#endif /* PROPELLER_H_ */
